package com.lbssoft.gpsbd.task;

import com.lbssoft.datalink.util.Log;
import com.lbssoft.gpsbd.service.StatisticsService;
import org.springframework.context.ApplicationContext;
import org.springframework.scheduling.annotation.Async;

import java.util.Date;

public class ScheduledTask {
	private static ApplicationContext applicationContext;
	StatisticsService statisticsService =applicationContext.getBean(StatisticsService.class);

	@Async
	public void deviceStatistics(){

		statisticsService.deviceTodayStatisics();
		try {
			Thread.sleep(1000 * 5);
		}catch (Exception e){

		}
		statisticsService.resetTodayTrip();

	}

	
	public static void setApplicationContext(ApplicationContext context) {
		    applicationContext = context;
		  }
	
	
}
